Пример #1
0
 public Skill(long amount, Database.Type type, Entity target, Player targetPlayer, Entity source, Player sourcePlayer, int skillId, bool hotdot,
     bool critic, long time, NpcInfo pet, HitDirection direction)
 {
     Amount = amount;
     Type = type;
     EntityTarget = target;
     EntitySource = source;
     PlayerTarget = targetPlayer;
     PlayerSource = sourcePlayer;
     SkillId = skillId;
     Critic = critic;
     HotDot = hotdot;
     Time = time;
     Pet = pet;
     Direction = direction;
     Source = source;
     Target = target;
     if(PlayerSource != null)
     {
         Source = PlayerSource.User;
     }
     if(PlayerTarget != null)
     {
         Target = PlayerTarget.User;
     }
 }
Пример #2
0
        public static UserEntity ForEntity(Entity entity)
        {
            var projectile = entity as ProjectileEntity;
            if (projectile != null)
                entity = projectile.Owner;

            return entity as UserEntity;
        }
Пример #3
0
 public static UserEntity ForEntity(Entity entity)
 {
     var ownedEntity = entity as IHasOwner;
     while (ownedEntity != null && ownedEntity.Owner != null)
     {
         entity = ownedEntity.Owner;
         ownedEntity = entity as IHasOwner;
     }
     return entity as UserEntity;
 }
Пример #4
0
 public NpcEntity(EntityId id, EntityId ownerId, Entity owner)
     : base(id)
 {
     OwnerId = ownerId;
     Owner = owner;
 }