Ejemplo n.º 1
0
        public override void Import(ClientEffect importObject, IEnumerable<FieldInfo> getters)
        {
            base.Import(importObject, getters);

            this.change = new ChangeList();
            var change = new Change();
            change.stat = modifiersenum.BOOST_HEAL;
            change.func = StatFunc.ADD;
            change.value = Int32.Parse(importObject.reserved[1].Trim()) * 10;
            this.change.Add(change);
        }
Ejemplo n.º 2
0
        public override void Import(ClientEffect importObject, IEnumerable<FieldInfo> getters)
        {
            base.Import(importObject, getters);

            this.armor = Utility.GetArmorType(importObject.reserved[4]);
            this.change = new ChangeList();
            var change = new Change();
            change.stat = modifiersenum.PHYSICAL_DEFENSE;
            change.value = Int32.Parse(importObject.reserved[1]);
            change.delta = Int32.Parse(importObject.reserved[0]);
            change.func = StatFunc.PERCENT;
            this.change.Add(change);
        }
Ejemplo n.º 3
0
        public override void Import(ClientEffect importObject, IEnumerable<FieldInfo> getters)
        {
            base.Import(importObject, getters);

            this.value = Int32.Parse(importObject.reserved[1].Trim());
            this.change = new ChangeList();
            var change = new Change();
            change.value = this.value;
            if (importObject.reserved[0] != null)
                change.delta = Int32.Parse(importObject.reserved[0].Trim());
            change.func = StatFunc.PERCENT;
            change.stat = modifiersenum.BOOST_HATE;
            this.change.Add(change);
        }
Ejemplo n.º 4
0
 public override void Import(ClientEffect importObject, IEnumerable<FieldInfo> getters)
 {
     base.Import(importObject, getters);
     base.change = new ChangeList();
     var change = new Change();
     change.func = StatFunc.PERCENT;
     change.stat = modifiersenum.SPEED;
     change.value = Int16.Parse(importObject.reserved[1]) - 100;
     base.change.Add(change);
     this.value = Int16.Parse(importObject.reserved[6]);
 }
Ejemplo n.º 5
0
        /*
        [XmlAttribute]
        public float percent;
        */
        public override void Import(ClientEffect importObject, IEnumerable<FieldInfo> getters)
        {
            base.Import(importObject, getters);

            // this.percent = Int32.Parse(importObject.reserved[1]);

            if (this.change == null)
                this.change = new ChangeList();
            Change change = new Change();
            Stat usedStat = Stat.HealSkillBoost;
            change.stat = new NamedEnum<modifiersenum>(usedStat.ToString());
            change.func = StatFunc.PERCENT;
            if (importObject.reserved[1] != null)
                change.value = Int32.Parse(importObject.reserved[1].Trim());
            this.change.Add(change);
        }
Ejemplo n.º 6
0
        public override void Import(ClientEffect importObject, IEnumerable<FieldInfo> getters)
        {
            base.Import(importObject, getters);

              this.change = new ChangeList();
              var change = new Change();
              change.stat = modifiersenum.BOOST_MANTRA_RANGE;
              change.value = Int32.Parse(importObject.reserved[1].Trim());
              change.func = StatFunc.PERCENT;

              if (importObject.reserved[8] != null && importObject.reserved[8].Trim() == "1") {
              /*
              Condition flycondition = new OnFlyCondition();
              if (change.conditions == null)
                  change.conditions = new Conditions();
              if (change.conditions.ConditionList == null)
                  change.conditions.ConditionList = new List<Condition>();
              change.conditions.ConditionList.Add(flycondition);
               */
              }

               this.change.Add(change);
        }
Ejemplo n.º 7
0
        public override void Import(ClientEffect importObject, IEnumerable<FieldInfo> getters)
        {
            base.Import(importObject, getters);

            if (importObject.reserved[0] != null) {
                int value = Int32.Parse(importObject.reserved[0].Trim());
                if (value == 99999) {
                    this.disable = true; // healing is disabled for 60 secs
                    //percent = value;
                    return;
                }
            }
            /*
            if (importObject.reserved[1] != null) {
                this.percent = Int32.Parse(importObject.reserved[1].Trim());
            }
            else {
                this.percent = 1;
            }
            */
            if (this.change == null)
                this.change = new ChangeList();
            Change change = new Change();
            Stat usedStat = Stat.HealSkillBoost;
            change.stat = new NamedEnum<modifiersenum>(usedStat.ToString());
            change.func = StatFunc.PERCENT;
            if(importObject.reserved[1] != null)
                change.value = -Int32.Parse(importObject.reserved[1].Trim());
            else
                change.value = -Int32.Parse(importObject.reserved[0].Trim());
            this.change.Add(change);
        }
Ejemplo n.º 8
0
        public override void Import(ClientEffect importObject, IEnumerable<FieldInfo> getters)
        {
            base.Import(importObject, getters);

            base.change = new ChangeList();
            var change = new Change();
            change.func = StatFunc.PERCENT;
            change.stat = modifiersenum.BOOST_CASTING_TIME;
            change.value = Int32.Parse(importObject.reserved[1]);
            base.change.Add(change);
        }
Ejemplo n.º 9
0
        public void Import(ClientEffect importObject, Type effectClass,
                           int addValuePos, int addDeltaPos,
                           int percValuePos, int percDeltaPos, int percentCheckPos,
                           Stat overrideStat)
        {
            if (this.change == null)
            {
                this.change = new ChangeList();
            }

            Stat usedStat = overrideStat == Stat.None ? importObject.ChangeStat : overrideStat;

            List <Stat> stats = new List <Stat>();

            if (usedStat == Stat.ElementalDefendAll || usedStat == Stat.AllResist)
            {
                stats.AddRange(new Stat[] { Stat.ElementalDefendWater, Stat.ElementalDefendAir,
                                            Stat.ElementalDefendFire, Stat.ElementalDefendEarth });
            }
            else if (usedStat == Stat.AllSpeed)
            {
                stats.AddRange(new Stat[] { Stat.Speed, Stat.FlySpeed });
            }
            else if (usedStat == Stat.PMAttack)
            {
                stats.AddRange(new Stat[] { Stat.PhyAttack, Stat.MagicalAttack });
            }
            else if (usedStat == Stat.PMDefend)
            {
                stats.AddRange(new Stat[] { Stat.PhysicalDefend, Stat.MagicalResist });
            }
            else if (usedStat == Stat.ActiveDefend)
            {
                stats.AddRange(new Stat[] { Stat.Dodge, Stat.Parry, Stat.Block });
            }
            else if (usedStat == Stat.ArStunLike)
            {
                stats.AddRange(new Stat[] { Stat.ArStun, Stat.ArStumble, Stat.ArStagger, Stat.ArSpin,
                                            Stat.OpenAerial });
            }
            else
            {
                stats.Add(usedStat);
            }

            foreach (Stat stat in stats)
            {
                var change = new Change();
                change.stat = new NamedEnum <modifiersenum>(stat.ToString());
                int isPercent;
                if (importObject.reserved[percentCheckPos] != null)
                {
                    int valueIdx;
                    int deltaIdx;
                    if (Int32.TryParse(importObject.reserved[percentCheckPos].Trim(), out isPercent) &&
                        isPercent == 1)
                    {
                        change.func = StatFunc.PERCENT;
                        valueIdx    = percValuePos;
                        deltaIdx    = percDeltaPos;
                    }
                    else
                    {
                        change.func = StatFunc.ADD;
                        valueIdx    = addValuePos;
                        deltaIdx    = addDeltaPos;
                    }
                    change.value = Int32.Parse(importObject.reserved[valueIdx].Trim());
                    if (importObject.reserved[deltaIdx] != null)
                    {
                        change.delta = Int32.Parse(importObject.reserved[deltaIdx].Trim());
                    }
                }
                else
                {
                    if (importObject.reserved[addValuePos] != null)
                    {
                        change.func  = StatFunc.ADD;
                        change.value = Int32.Parse(importObject.reserved[addValuePos].Trim());
                        if (importObject.reserved[addDeltaPos] != null)
                        {
                            change.delta = Int32.Parse(importObject.reserved[addDeltaPos].Trim());
                        }
                    }
                    if (change.value == 0 && change.delta == 0)
                    {
                        change.func  = StatFunc.PERCENT;
                        change.value = Int32.Parse(importObject.reserved[percValuePos].Trim());
                        if (importObject.reserved[percDeltaPos] != null)
                        {
                            change.delta = Int32.Parse(importObject.reserved[percDeltaPos].Trim());
                        }
                    }
                }
                if (stat.ToString().EndsWith("Delay") || effectClass.Equals(typeof(CurseEffect)))
                {
                    change.value = -change.value;
                    //if (effectClass.Equals(typeof(SlowEffect)))
                    change.delta = -change.delta;
                }
                if ((stat == Stat.Speed || stat == Stat.FlySpeed) && change.func == StatFunc.ADD)
                {
                    change.value *= 100;
                }
                if (stat == Stat.AttackRange && change.func == StatFunc.ADD)
                {
                    change.value *= 1000;
                }

                this.change.Add(change);
            }
        }