示例#1
0
        public static Condition CreateCondition(ConditionIds id, ConditionFlags type, int ticks, int param = 0,
                                                bool buff = false, uint subId = 0)
        {
            switch (type)
            {
            case ConditionFlags.Poison:
            case ConditionFlags.Fire:
            case ConditionFlags.Energy:
            case ConditionFlags.Drown:
            case ConditionFlags.Freezing:
            case ConditionFlags.Dazzled:
            case ConditionFlags.Cursed:
            case ConditionFlags.Bleeding:
                return(new ConditionDamage(id, type, buff, subId));

            case ConditionFlags.Haste:
            case ConditionFlags.Paralyze:
                return(new ConditionSpeed(id, type, ticks, buff, subId, param));

            case ConditionFlags.Invisible:
                return(new ConditionInvisible(id, type, ticks, buff, subId));

            case ConditionFlags.Outfit:
                return(new ConditionOutfit(id, type, ticks, buff, subId));

            case ConditionFlags.Light:
                return(new ConditionLight(id, type, ticks, buff, subId, (byte)(param & 0xFF),
                                          (byte)((param & 0xFF00) >> 8)));

            case ConditionFlags.Regeneration:
                return(new ConditionRegeneration(id, type, ticks, buff, subId));

            case ConditionFlags.Soul:
                return(new ConditionSoul(id, type, ticks, buff, subId));

            case ConditionFlags.Attributes:
                return(new ConditionAttributes(id, type, ticks, buff, subId));

            case ConditionFlags.SpellCooldown:
                return(new ConditionSpellCooldown(id, type, ticks, buff, subId));

            case ConditionFlags.SpellGroupCooldown:
                return(new ConditionSpellGroupCooldown(id, type, ticks, buff, subId));

            case ConditionFlags.InFight:
            case ConditionFlags.Drunk:
            case ConditionFlags.ExhaustWeapon:
            case ConditionFlags.ExhaustCombat:
            case ConditionFlags.ExhaustHeal:
            case ConditionFlags.Muted:
            case ConditionFlags.ChannelMutedTicks:
            case ConditionFlags.YellTicks:
            case ConditionFlags.Pacified:
            case ConditionFlags.ManaShield:
                return(new ConditionGeneric(id, type, ticks, buff, subId));

            default:
                return(null);
            }
        }
示例#2
0
 public ConditionSoul(ConditionIds id, ConditionFlags type, int ticks, bool buff = false, uint subId = 0)
     : base(id, type, ticks, buff, subId)
 {
     InternalSoulTicks = 0;
     SoulTicks         = 0;
     SoulGain          = 0;
 }
示例#3
0
 public ConditionSpeed(ConditionIds id, ConditionFlags type, int ticks, bool buff, uint subId, int changeSpeed)
     : base(id, type, ticks, buff, subId)
 {
     SpeedDelta = changeSpeed;
     MinA       = 0.0f;
     MinB       = 0.0f;
     MaxA       = 0.0f;
     MaxB       = 0.0f;
 }
示例#4
0
        protected Condition(ConditionIds id, ConditionFlags type, int ticks, bool buff = false, uint subId = 0)
        {
            SubId         = subId;
            Ticks         = ticks;
            ConditionType = type;
            Id            = id;
            IsBuff        = buff;

            EndTime = Ticks == -1 ? long.MaxValue : 0;
        }
示例#5
0
 public ConditionLight(ConditionIds id, ConditionFlags type, int ticks, bool buff, uint subId, byte lightLevel,
                       byte lightColor)
     : base(id, type, ticks, buff, subId)
 {
     LightInfo = new LightInfo
     {
         Level = lightLevel,
         Color = lightColor
     };
     InternalLightTicks  = 0;
     LightChangeInterval = 0;
 }
示例#6
0
        public ConditionRegeneration(ConditionIds id, ConditionFlags type, int ticks, bool buff = false, uint subId = 0)
            : base(id, type, ticks, buff, subId)
        {
            InternalHealthTicks = 0;
            InternalManaTicks   = 0;

            HealthTicks = 1000;
            ManaTicks   = 1000;

            HealthGain = 0;
            ManaGain   = 0;
        }
示例#7
0
        public ConditionAttributes(ConditionIds id, ConditionFlags type, int ticks, bool buff = false, uint subId = 0)
            : base(id, type, ticks, buff, subId)
        {
            CurrentSkill = 0;
            CurrentStat  = 0;

            const byte arrayLength = (byte)Enums.Stats.Last + 1;

            Skills        = new int[arrayLength];
            SkillsPercent = new int[arrayLength];
            Stats         = new int[arrayLength];
            StatsPercent  = new int[arrayLength];
        }
示例#8
0
 public ConditionDamage(ConditionIds id, ConditionFlags type, bool buff = false, uint subId = 0)
     : base(id, type, 0, buff, subId)
 {
     Delayed          = false;
     ForceUpdate      = false;
     Field            = false;
     Owner            = 0;
     MinDamage        = 0;
     MaxDamage        = 0;
     StartDamage      = 0;
     PeriodDamage     = 0;
     PeriodDamageTick = 0;
     TickInterval     = 2000;
 }
 public ConditionSpellGroupCooldown(ConditionIds id, ConditionFlags type, int ticks, bool buff = false, uint subId = 0) : base(id, type, ticks, buff, subId)
 {
 }
示例#10
0
 public ConditionOutfit(ConditionIds id, ConditionFlags type, int ticks, bool buff, uint subId = 0)
     : base(id, type, ticks, buff, subId)
 {
     Outfit = new Outfit();
 }
示例#11
0
 public ConditionInvisible(ConditionIds id, ConditionFlags type, int ticks, bool buff = false, uint subId = 0)
     : base(id, type, ticks, buff, subId)
 {
 }