Exemple #1
0
        public SortedList <int, L2Object> getAffectedTargets(L2Character actor)
        {
            SortedList <int, L2Object> targets = new SortedList <int, L2Object>();

            switch (affect_scope)
            {
            case TSkillScope.single:
            {
                switch (target_type)
                {
                case TSkillTarget.self:
                    targets.Add(actor.ObjID, actor);
                    break;

                case TSkillTarget.friend:
                case TSkillTarget.enemy:
                case TSkillTarget.any:
                case TSkillTarget.target:
                    if (actor.CurrentTarget != null)
                    {
                        targets.Add(actor.CurrentTarget.ObjID, actor.CurrentTarget);
                    }
                    break;

                case TSkillTarget.master:
                    if (actor is L2Summon)
                    {
                        targets.Add(((L2Summon)actor).Owner.ObjID, ((L2Summon)actor).Owner);
                    }
                    break;

                case TSkillTarget.unlockable:
                {
                    if (actor.CurrentTarget != null && actor.CurrentTarget is L2Door)
                    {
                        targets.Add(actor.CurrentTarget.ObjID, actor.CurrentTarget);
                    }
                }
                break;
                }
            }
            break;

            case TSkillScope.party:
                L2Character[] members = actor.getPartyCharacters();
                foreach (L2Character member in members)
                {
                    double dis = Calcs.calculateDistance(actor, member, true);
                    if (dis < cast_range)
                    {
                        targets.Add(member.ObjID, member);
                    }
                }
                break;
            }

            return(targets);
        }