Example #1
0
        private static void GenerateAngelInitiativeSkill(SkillTemplate template, int lv)
        {
            Skill s = EntityFactory.GenerateASkill(lv, template);
            string buff1Value = String.Empty;
            string buff2Value = String.Empty;
            s.SkillParam = template.SkillParam;

            if (template.Buff1 > 0)
            {
                Buff b1 = EntityFactory.GenerateBuff(lv, template, 1, out buff1Value);
                s.Buff = b1.ID.ToString();
                s.Description = s.Description.Replace("{B1}", buff1Value.ToString());
                s.SkillParam += "," + b1.ID.ToString();
                DBConfigMgr.Instance.MapBuff.Add(b1.ID, b1);
            }

            if (template.Buff2 > 0)
            {
                Buff b2 = EntityFactory.GenerateBuff(lv, template, 2, out buff2Value);
                s.Buff += "," + b2.ID.ToString();
                s.Description = s.Description.Replace("{B2}", buff2Value.ToString());
                s.SkillParam += "," + b2.ID.ToString();
                DBConfigMgr.Instance.MapBuff.Add(b2.ID, b2);
            }

            DBConfigMgr.Instance.MapSkill.Add(s.ID, s);
        }
Example #2
0
        public static Buff GenerateBuff(int lv, SkillTemplate template,int buffIndex,out string value)
        {
            Buff b = new Buff();
            b.ID = 1;
            value = "0";

            if (DBConfigMgr.Instance.MapBuff != null && DBConfigMgr.Instance.MapBuff.Count > 0)
            {
                b.ID = DBConfigMgr.Instance.MapBuff.Keys.Max() + 1;
            }

            b.Time = template.Time;
            b.Target = template.Target;
            b.ModelPath = "";
            b.ModelOffset = 0;

            if (buffIndex == 1 && template.Buff1 > 0)
            {
                b.BuffType = template.Buff1Type;
                b.Name = String.Format("{0}Lv{1}Buff1", template.Name, lv);
                b.Positive = template.Buff1InitialValue > 0 ? 1 : 0;

                value = ComplementBuffValue(template.Buff1InitialValue, template.Buff1Growth, lv);
                b.BuffKV = String.Format("{0},{1}", template.Buff1, value);

                // 负的效果转成正的
                value = value.Replace("-", "");
            }

            if (buffIndex == 2 && template.Buff2 > 0)
            {
                b.BuffType = template.Buff2Type;
                b.Name = String.Format("{0}Lv{1}Buff2", template.Name, lv);
                b.Positive = template.Buff2InitialValue > 0 ? 1 : 0;

                value = ComplementBuffValue(template.Buff2InitialValue, template.Buff2Growth, lv);
                b.BuffKV = String.Format("{0},{1}", template.Buff2, value);

                // 负的效果转成正的
                value = value.Replace("-", "");
            }

            return b;
        }
Example #3
0
 public static Skill GenerateASkill(int lv, SkillTemplate template)
 {
     Skill s = new Skill();
     s.ID = GenerateSkillID(template.ID,lv);
     s.IconID = template.IconID;
     s.MaxHit = template.MaxHit;
     s.Name = template.Name;
     s.EffectID = template.EffectID;
     s.EffectRange = template.EffectRange;
     s.ConditionParam = template.ConditionParam;
     s.ConditionType = template.ConditionType;
     s.EffectBullet = 0;
     s.CoolDown = template.CoolDown;
     s.Possiblity = template.Possibility;
     s.SkillCategory = template.Category;
     s.Description = template.Description;
     s.SkillParam = String.Empty;
     s.Buff = String.Empty;
     s.SkillType = template.SkillType.Trim();
     return s;
 }
Example #4
0
        private static void GenerateInitiativeSKill(SkillTemplate template, int lv)
        {
            Skill s = EntityFactory.GenerateASkill(lv, template);
            string buff1Value = String.Empty;
            string buff2Value = String.Empty;
            s.SkillParam = string.Format("{0},{1},{2},{3}", template.ConditionType, template.Possibility,
                template.MaxHit, template.EffectRange);

            if (template.Buff1 > 0)
            {
                Buff b1 = EntityFactory.GenerateBuff(lv, template, 1, out buff1Value);
                s.Buff = b1.ID.ToString();
                s.Description = s.Description.Replace("{B1}", buff1Value.ToString());
                s.SkillParam += "," + b1.ID.ToString();
                DBConfigMgr.Instance.MapBuff.Add(b1.ID, b1);
            }

            if (template.Buff2 > 0)
            {
                Buff b2 = EntityFactory.GenerateBuff(lv, template, 2, out buff2Value);
                s.Buff += "," + b2.ID.ToString();
                s.Description = s.Description.Replace("{B2}", buff2Value.ToString());
                s.SkillParam += "," + b2.ID.ToString();
                DBConfigMgr.Instance.MapBuff.Add(b2.ID, b2);
            }

            DBConfigMgr.Instance.MapSkill.Add(s.ID, s);
        }
Example #5
0
        private static void GenerateAngleSummonSkill(SkillTemplate template, int lv)
        {
            Skill s = EntityFactory.GenerateASkill(lv, template);
            s.SkillParam = template.SkillParam;

            int level = (int)(1 + 2.5 * (lv - 1));
            int count = (int)(10 + 0.25 * (lv - 1));

            s.SkillParam += string.Format(",{0},{1}", count, level);
            s.Description = s.Description.Replace("{B1}", count.ToString()).Replace("{B2}", level.ToString());

            DBConfigMgr.Instance.MapSkill.Add(s.ID, s);
        }