Beispiel #1
0
        public void SetOperateCond(string value)
        {
            if (value.StartsWithIgnoreCase("{"))
            {
                return;
            }

            foreach (string str in value.Split(';'))
            {
                SkillCondType type = (SkillCondType)Enum.Parse(typeof(SkillCondType), str.Split(' ')[0]);
                SkillCond     cond = EffectRegistrator.GetInstance().BuildCond(type, str);

                Conditions.Add(cond);
            }
        }
        public SkillCond BuildCond(SkillCondType type, string str)
        {
            SkillCond cond = null;

            switch (type)
            {
            case SkillCondType.CanSummonCubic:
                cond = new CanSummonCubic();
                break;
            }

            cond?.Build(str);

            return(cond);
        }
Beispiel #3
0
        public void SetOperateCond(string value)
        {
            if (value.StartsWithIgnoreCase("{"))
            {
                return;
            }

            foreach (string str in value.Split(';'))
            {
                var           tempValue    = str.Split(' ')[0];
                var           newTempValue = StringHelper.ToTitleCase(tempValue, '_');
                SkillCondType type         = (SkillCondType)Enum.Parse(typeof(SkillCondType), newTempValue);
                SkillCond     cond         = EffectRegistrator.GetInstance().BuildCond(type, str);

                Conditions.Add(cond);
            }
        }
Beispiel #4
0
        public bool ConditionOk(L2Player target)
        {
            if (Conditions.Count == 0)
            {
                return(true);
            }

            sbyte retcode = -2;

            SkillCond cond = Conditions.FirstOrDefault(c => !c.CanUse(target, this));

            if (cond != null)
            {
                retcode = cond.Retcode;
            }

            if (retcode == -1)
            {
                target.SendPacket(new SystemMessage(SystemMessage.SystemMessageId.S1CannotBeUsed).AddSkillName(SkillId, Level));
            }

            return(retcode == -2);
        }