Example #1
0
 private void BuffAdd_Click(object sender, EventArgs e)
 {
     int Index = 0;
     for (int i = 0; i < Settings.Guild_BuffList.Count; i++)
         if (Index < Settings.Guild_BuffList[i].Id)
             Index = Settings.Guild_BuffList[i].Id;
     GuildBuffInfo NewBuff = new GuildBuffInfo();
     NewBuff.Id = ++Index;
     NewBuff.name = "Buff " + Index.ToString();
     Settings.Guild_BuffList.Add(NewBuff);
     BuffList.Items.Add(NewBuff);
     GuildsChanged = true;
 }
Example #2
0
        public void NewBuff(int Id, bool charge = true)
        {
            GuildBuffInfo info = Envir.FindGuildBuffInfo(Id);

            if (info == null)
            {
                return;
            }

            GuildBuff buff = new GuildBuff()
            {
                Id     = Id,
                Info   = info,
                Active = true,
            };

            buff.ActiveTimeRemaining = buff.Info.TimeLimit;

            if (charge)
            {
                ChargeForBuff(buff);
            }

            BuffList.Add(buff);
            List <GuildBuff> NewBuff = new List <GuildBuff>
            {
                buff
            };

            SendServerPacket(new ServerPackets.GuildBuffList {
                ActiveBuffs = NewBuff
            });

            //now tell everyone our new sparepoints
            for (int i = 0; i < Ranks.Count; i++)
            {
                for (int j = 0; j < Ranks[i].Members.Count; j++)
                {
                    if (Ranks[i].Members[j].Player != null)
                    {
                        SendGuildStatus((PlayerObject)Ranks[i].Members[j].Player);
                    }
                }
            }

            NeedSave = true;
            RefreshAllStats();
        }
Example #3
0
        private void BuffAdd_Click(object sender, EventArgs e)
        {
            int Index = 0;

            for (int i = 0; i < Settings.Guild_BuffList.Count; i++)
            {
                if (Index < Settings.Guild_BuffList[i].Id)
                {
                    Index = Settings.Guild_BuffList[i].Id;
                }
            }
            GuildBuffInfo NewBuff = new GuildBuffInfo();

            NewBuff.Id   = ++Index;
            NewBuff.name = "Buff " + Index.ToString();
            Settings.Guild_BuffList.Add(NewBuff);
            BuffList.Items.Add(NewBuff);
            GuildsChanged = true;
        }
Example #4
0
        public void NewBuff(int Id)
        {
            GuildBuffInfo Info = Envir.FindGuildBuffInfo(Id);

            if (Info == null)
            {
                return;
            }
            GuildBuff Buff = new GuildBuff()
            {
                Id     = Id,
                Info   = Info,
                Active = true,
            };

            Buff.ActiveTimeRemaining = Buff.Info.TimeLimit;

            SparePoints -= Buff.Info.PointsRequirement;

            BuffList.Add(Buff);
            List <GuildBuff> NewBuff = new List <GuildBuff>();

            NewBuff.Add(Buff);
            SendServerPacket(new ServerPackets.GuildBuffList {
                ActiveBuffs = NewBuff
            });
            //now tell everyone our new sparepoints
            for (int i = 0; i < Ranks.Count; i++)
            {
                for (int j = 0; j < Ranks[i].Members.Count; j++)
                {
                    if (Ranks[i].Members[j].Player != null)
                    {
                        SendGuildStatus((PlayerObject)Ranks[i].Members[j].Player);
                    }
                }
            }
            NeedSave = true;
            RefreshAllStats();
        }
Example #5
0
        private void UpdateGuildInterface()
        {
            GuildMinOwnerLeveltextBox.Text = Settings.Guild_RequiredLevel.ToString();
            GuildPPLtextBox.Text           = Settings.Guild_PointPerLevel.ToString();
            GuildExpratetextBox.Text       = Settings.Guild_ExpRate.ToString();
            WarLengthTextBox.Text          = Settings.Guild_WarTime.ToString();
            WarCostTextBox.Text            = Settings.Guild_WarCost.ToString();

            if ((GuildLevelListcomboBox.SelectedItem == null) || (GuildLevelListcomboBox.SelectedIndex >= Settings.Guild_ExperienceList.Count) || (GuildLevelListcomboBox.SelectedIndex >= Settings.Guild_MembercapList.Count))
            {
                GuildExpNeededtextBox.Text = string.Empty;
                GuildMemberCaptextBox.Text = string.Empty;
            }
            else
            {
                GuildExpNeededtextBox.Text = Settings.Guild_ExperienceList[GuildLevelListcomboBox.SelectedIndex].ToString();
                GuildMemberCaptextBox.Text = Settings.Guild_MembercapList[GuildLevelListcomboBox.SelectedIndex].ToString();
            }
            if ((GuildCreateListcomboBox.SelectedItem == null) || (GuildCreateListcomboBox.SelectedIndex >= Settings.Guild_CreationCostList.Count))
            {
                GuildItemNamecomboBox.SelectedIndex = 0;
                GuildAmounttextBox.Text             = string.Empty;
            }
            else
            {
                if (Settings.Guild_CreationCostList[GuildCreateListcomboBox.SelectedIndex].Item == null)
                {
                    GuildItemNamecomboBox.SelectedIndex = 0;
                }
                else
                {
                    GuildItemNamecomboBox.SelectedIndex = Settings.Guild_CreationCostList[GuildCreateListcomboBox.SelectedIndex].Item.Index;
                }
                GuildAmounttextBox.Text = Settings.Guild_CreationCostList[GuildCreateListcomboBox.SelectedIndex].Amount.ToString();
            }
            if (BuffList.SelectedItem == null)
            {
                SelectedBuff               = null;
                BuffPanel.Enabled          = false;
                BufflblIndex.Text          = "No Buff Selected";
                BufftxtName.Text           = string.Empty;
                BuffTxtLevelReq.Text       = string.Empty;
                BufftxtPointsReq.Text      = string.Empty;
                BufftxtTimeLimit.Text      = string.Empty;
                BufftxtActivationCost.Text = string.Empty;
                bufftxtIcon.Text           = string.Empty;
                BufftxtAc.Text             = string.Empty;
                BufftxtMac.Text            = string.Empty;
                BufftxtDc.Text             = string.Empty;
                BufftxtMc.Text             = string.Empty;
                BufftxtSc.Text             = string.Empty;
                BufftxtAttack.Text         = string.Empty;
                BufftxtHpRegen.Text        = string.Empty;
                BufftxtMpRegen.Text        = string.Empty;
                BufftxtMaxHp.Text          = string.Empty;
                BufftxtMaxMp.Text          = string.Empty;
                BufftxtMineRate.Text       = string.Empty;
                BufftxtGemRate.Text        = string.Empty;
                BufftxtFishRate.Text       = string.Empty;
                BufftxtExpRate.Text        = string.Empty;
                BufftxtCraftRate.Text      = string.Empty;
                BufftxtSkillRate.Text      = string.Empty;
                BufftxtDropRate.Text       = string.Empty;
                BufftxtGoldRate.Text       = string.Empty;
            }
            else
            {
                SelectedBuff               = (GuildBuffInfo)BuffList.SelectedItem;
                BuffPanel.Enabled          = true;
                BufflblIndex.Text          = string.Format("Index:  {0}", SelectedBuff.Id);
                BufftxtName.Text           = SelectedBuff.name;
                BuffTxtLevelReq.Text       = SelectedBuff.LevelRequirement.ToString();
                BufftxtPointsReq.Text      = SelectedBuff.PointsRequirement.ToString();
                BufftxtTimeLimit.Text      = SelectedBuff.TimeLimit.ToString();
                BufftxtActivationCost.Text = SelectedBuff.ActivationCost.ToString();
                bufftxtIcon.Text           = SelectedBuff.Icon.ToString();
                BufftxtAc.Text             = SelectedBuff.BuffAc.ToString();
                BufftxtMac.Text            = SelectedBuff.BuffMac.ToString();
                BufftxtDc.Text             = SelectedBuff.BuffDc.ToString();
                BufftxtMc.Text             = SelectedBuff.BuffMc.ToString();
                BufftxtSc.Text             = SelectedBuff.BuffSc.ToString();
                BufftxtAttack.Text         = SelectedBuff.BuffAttack.ToString();
                BufftxtHpRegen.Text        = SelectedBuff.BuffHpRegen.ToString();
                BufftxtMpRegen.Text        = SelectedBuff.BuffMPRegen.ToString();
                BufftxtMaxHp.Text          = SelectedBuff.BuffMaxHp.ToString();
                BufftxtMaxMp.Text          = SelectedBuff.BuffMaxMp.ToString();
                BufftxtMineRate.Text       = SelectedBuff.BuffMineRate.ToString();
                BufftxtGemRate.Text        = SelectedBuff.BuffGemRate.ToString();
                BufftxtFishRate.Text       = SelectedBuff.BuffFishRate.ToString();
                BufftxtExpRate.Text        = SelectedBuff.BuffExpRate.ToString();
                BufftxtCraftRate.Text      = SelectedBuff.BuffCraftRate.ToString();
                BufftxtSkillRate.Text      = SelectedBuff.BuffSkillRate.ToString();
                BufftxtDropRate.Text       = SelectedBuff.BuffDropRate.ToString();
                BufftxtGoldRate.Text       = SelectedBuff.BuffGoldRate.ToString();
            }
        }
Example #6
0
        private void UpdateGuildInterface()
        {
            GuildMinOwnerLeveltextBox.Text = Settings.Guild_RequiredLevel.ToString();
            GuildPPLtextBox.Text = Settings.Guild_PointPerLevel.ToString();
            GuildExpratetextBox.Text = Settings.Guild_ExpRate.ToString();
            WarLengthTextBox.Text = Settings.Guild_WarTime.ToString();
            WarCostTextBox.Text = Settings.Guild_WarCost.ToString();

            if ((GuildLevelListcomboBox.SelectedItem == null) || (GuildLevelListcomboBox.SelectedIndex >= Settings.Guild_ExperienceList.Count) || (GuildLevelListcomboBox.SelectedIndex >= Settings.Guild_MembercapList.Count))
            {
                GuildExpNeededtextBox.Text = string.Empty;
                GuildMemberCaptextBox.Text = string.Empty;
            }
            else
            {
                GuildExpNeededtextBox.Text = Settings.Guild_ExperienceList[GuildLevelListcomboBox.SelectedIndex].ToString();
                GuildMemberCaptextBox.Text = Settings.Guild_MembercapList[GuildLevelListcomboBox.SelectedIndex].ToString();
            }
            if ((GuildCreateListcomboBox.SelectedItem == null) || (GuildCreateListcomboBox.SelectedIndex >= Settings.Guild_CreationCostList.Count))
            {
                GuildItemNamecomboBox.SelectedIndex = 0;
                GuildAmounttextBox.Text = string.Empty;
            }
            else
            {
                if (Settings.Guild_CreationCostList[GuildCreateListcomboBox.SelectedIndex].Item == null)
                    GuildItemNamecomboBox.SelectedIndex = 0;
                else
                    GuildItemNamecomboBox.SelectedIndex = Settings.Guild_CreationCostList[GuildCreateListcomboBox.SelectedIndex].Item.Index;
                GuildAmounttextBox.Text = Settings.Guild_CreationCostList[GuildCreateListcomboBox.SelectedIndex].Amount.ToString();
            }
            if (BuffList.SelectedItem == null)
            {
                SelectedBuff = null;
                BuffPanel.Enabled = false;
                BufflblIndex.Text = "No Buff Selected";
                BufftxtName.Text = string.Empty;
                BuffTxtLevelReq.Text = string.Empty;
                BufftxtPointsReq.Text = string.Empty;
                BufftxtTimeLimit.Text = string.Empty;
                BufftxtActivationCost.Text = string.Empty;
                bufftxtIcon.Text = string.Empty;
                BufftxtAc.Text = string.Empty;
                BufftxtMac.Text = string.Empty;
                BufftxtDc.Text = string.Empty;
                BufftxtMc.Text = string.Empty;
                BufftxtSc.Text = string.Empty;
                BufftxtAttack.Text = string.Empty;
                BufftxtHpRegen.Text = string.Empty;
                BufftxtMpRegen.Text = string.Empty;
                BufftxtMaxHp.Text = string.Empty;
                BufftxtMaxMp.Text = string.Empty;
                BufftxtMineRate.Text = string.Empty;
                BufftxtGemRate.Text = string.Empty;
                BufftxtFishRate.Text = string.Empty;
                BufftxtExpRate.Text = string.Empty;
                BufftxtCraftRate.Text = string.Empty;
                BufftxtSkillRate.Text = string.Empty;
                BufftxtDropRate.Text = string.Empty;
                BufftxtGoldRate.Text = string.Empty;
            }
            else
            {
                SelectedBuff  = (GuildBuffInfo)BuffList.SelectedItem;
                BuffPanel.Enabled = true;
                BufflblIndex.Text = string.Format("Index:  {0}", SelectedBuff.Id);
                BufftxtName.Text = SelectedBuff.name;
                BuffTxtLevelReq.Text = SelectedBuff.LevelRequirement.ToString();
                BufftxtPointsReq.Text = SelectedBuff.PointsRequirement.ToString();
                BufftxtTimeLimit.Text = SelectedBuff.TimeLimit.ToString();
                BufftxtActivationCost.Text = SelectedBuff.ActivationCost.ToString();
                bufftxtIcon.Text = SelectedBuff.Icon.ToString();
                BufftxtAc.Text = SelectedBuff.BuffAc.ToString();
                BufftxtMac.Text = SelectedBuff.BuffMac.ToString();
                BufftxtDc.Text = SelectedBuff.BuffDc.ToString();
                BufftxtMc.Text = SelectedBuff.BuffMc.ToString();
                BufftxtSc.Text = SelectedBuff.BuffSc.ToString();
                BufftxtAttack.Text = SelectedBuff.BuffAttack.ToString();
                BufftxtHpRegen.Text = SelectedBuff.BuffHpRegen.ToString();
                BufftxtMpRegen.Text = SelectedBuff.BuffMPRegen.ToString();
                BufftxtMaxHp.Text = SelectedBuff.BuffMaxHp.ToString();
                BufftxtMaxMp.Text = SelectedBuff.BuffMaxMp.ToString();
                BufftxtMineRate.Text = SelectedBuff.BuffMineRate.ToString();
                BufftxtGemRate.Text = SelectedBuff.BuffGemRate.ToString();
                BufftxtFishRate.Text = SelectedBuff.BuffFishRate.ToString();
                BufftxtExpRate.Text = SelectedBuff.BuffExpRate.ToString();
                BufftxtCraftRate.Text = SelectedBuff.BuffCraftRate.ToString();
                BufftxtSkillRate.Text = SelectedBuff.BuffSkillRate.ToString();
                BufftxtDropRate.Text = SelectedBuff.BuffDropRate.ToString();
                BufftxtGoldRate.Text = SelectedBuff.BuffGoldRate.ToString();
            }
        }
Example #7
0
        private void UpdateGuildInterface()
        {
            GuildMinOwnerLeveltextBox.Text = Settings.Guild_RequiredLevel.ToString();
            GuildPPLtextBox.Text           = Settings.Guild_PointPerLevel.ToString();
            GuildExpratetextBox.Text       = Settings.Guild_ExpRate.ToString();
            WarLengthTextBox.Text          = Settings.Guild_WarTime.ToString();
            WarCostTextBox.Text            = Settings.Guild_WarCost.ToString();

            if ((GuildLevelListcomboBox.SelectedItem == null) || (GuildLevelListcomboBox.SelectedIndex >= Settings.Guild_ExperienceList.Count) || (GuildLevelListcomboBox.SelectedIndex >= Settings.Guild_MembercapList.Count))
            {
                GuildExpNeededtextBox.Text = string.Empty;
                GuildMemberCaptextBox.Text = string.Empty;
            }
            else
            {
                GuildExpNeededtextBox.Text = Settings.Guild_ExperienceList[GuildLevelListcomboBox.SelectedIndex].ToString();
                GuildMemberCaptextBox.Text = Settings.Guild_MembercapList[GuildLevelListcomboBox.SelectedIndex].ToString();
            }
            if ((GuildCreateListcomboBox.SelectedItem == null) || (GuildCreateListcomboBox.SelectedIndex >= Settings.Guild_CreationCostList.Count))
            {
                GuildItemNamecomboBox.SelectedIndex = 0;
                GuildAmounttextBox.Text             = string.Empty;
            }
            else
            {
                if (Settings.Guild_CreationCostList[GuildCreateListcomboBox.SelectedIndex].Item == null)
                {
                    GuildItemNamecomboBox.SelectedIndex = 0;
                }
                else
                {
                    GuildItemNamecomboBox.SelectedIndex = Settings.Guild_CreationCostList[GuildCreateListcomboBox.SelectedIndex].Item.Index;
                }
                GuildAmounttextBox.Text = Settings.Guild_CreationCostList[GuildCreateListcomboBox.SelectedIndex].Amount.ToString();
            }
            if (BuffList.SelectedItem == null)
            {
                SelectedBuff               = null;
                BuffPanel.Enabled          = false;
                BufflblIndex.Text          = "No Buff Selected";
                BufftxtName.Text           = string.Empty;
                BuffTxtLevelReq.Text       = string.Empty;
                BufftxtPointsReq.Text      = string.Empty;
                BufftxtTimeLimit.Text      = string.Empty;
                BufftxtActivationCost.Text = string.Empty;
                bufftxtIcon.Text           = string.Empty;
                BufftxtAc.Text             = string.Empty;
                BufftxtMac.Text            = string.Empty;
                BufftxtDc.Text             = string.Empty;
                BufftxtMc.Text             = string.Empty;
                BufftxtSc.Text             = string.Empty;
                BufftxtAttack.Text         = string.Empty;
                BufftxtHpRegen.Text        = string.Empty;
                BufftxtMpRegen.Text        = string.Empty;
                BufftxtMaxHp.Text          = string.Empty;
                BufftxtMaxMp.Text          = string.Empty;
                BufftxtMineRate.Text       = string.Empty;
                BufftxtGemRate.Text        = string.Empty;
                BufftxtFishRate.Text       = string.Empty;
                BufftxtExpRate.Text        = string.Empty;
                BufftxtCraftRate.Text      = string.Empty;
                BufftxtSkillRate.Text      = string.Empty;
                BufftxtDropRate.Text       = string.Empty;
                BufftxtGoldRate.Text       = string.Empty;
            }
            else
            {
                SelectedBuff               = (GuildBuffInfo)BuffList.SelectedItem;
                BuffPanel.Enabled          = true;
                BufflblIndex.Text          = $"Index:  {SelectedBuff.Id}";
                BufftxtName.Text           = SelectedBuff.name;
                BuffTxtLevelReq.Text       = SelectedBuff.LevelRequirement.ToString();
                BufftxtPointsReq.Text      = SelectedBuff.PointsRequirement.ToString();
                BufftxtTimeLimit.Text      = SelectedBuff.TimeLimit.ToString();
                BufftxtActivationCost.Text = SelectedBuff.ActivationCost.ToString();
                bufftxtIcon.Text           = SelectedBuff.Icon.ToString();
                BufftxtAc.Text             = SelectedBuff.Stats[Stat.MaxAC].ToString();
                BufftxtMac.Text            = SelectedBuff.Stats[Stat.MaxMAC].ToString();
                BufftxtDc.Text             = SelectedBuff.Stats[Stat.MaxDC].ToString();
                BufftxtMc.Text             = SelectedBuff.Stats[Stat.MaxMC].ToString();
                BufftxtSc.Text             = SelectedBuff.Stats[Stat.MaxSC].ToString();
                BufftxtAttack.Text         = SelectedBuff.Stats[Stat.AttackBonus].ToString();
                BufftxtHpRegen.Text        = SelectedBuff.Stats[Stat.HealthRecovery].ToString();
                BufftxtMpRegen.Text        = SelectedBuff.Stats[Stat.SpellRecovery].ToString();
                BufftxtMaxHp.Text          = SelectedBuff.Stats[Stat.HP].ToString();
                BufftxtMaxMp.Text          = SelectedBuff.Stats[Stat.MP].ToString();
                BufftxtMineRate.Text       = SelectedBuff.Stats[Stat.MineRatePercent].ToString();
                BufftxtGemRate.Text        = SelectedBuff.Stats[Stat.GemRatePercent].ToString();
                BufftxtFishRate.Text       = SelectedBuff.Stats[Stat.FishRatePercent].ToString();
                BufftxtExpRate.Text        = SelectedBuff.Stats[Stat.ExpRatePercent].ToString();
                BufftxtCraftRate.Text      = SelectedBuff.Stats[Stat.CraftRatePercent].ToString();
                BufftxtSkillRate.Text      = SelectedBuff.Stats[Stat.SkillGainMultiplier].ToString();
                BufftxtDropRate.Text       = SelectedBuff.Stats[Stat.ItemDropRatePercent].ToString();
                BufftxtGoldRate.Text       = SelectedBuff.Stats[Stat.GoldDropRatePercent].ToString();
            }
        }