Inheritance: IDisposable
Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Stats"></param>
 public void UnMerge(GenericStats Stats)
 {
     foreach (var effect in Stats.Effects)
     {
         if (!m_effects.ContainsKey(effect.Key))
         {
             m_effects.Add(effect.Key, new GenericEffect(effect.Key));
         }
         m_effects[effect.Key].UnMerge(effect.Value);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Stats"></param>
 public void UnMerge(StatsType type, GenericStats Stats)
 {
     foreach (var effect in Stats.Effects.Except(Stats.WeaponEffects))
     {
         if (!m_effects.ContainsKey(effect.Key))
         {
             m_effects.Add(effect.Key, new GenericEffect(effect.Key));
         }
         m_effects[effect.Key].UnMerge(type, effect.Value);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <param name="monsterGrade"></param>
        /// <param name="invocator"></param>
        /// <param name="staticInvocation"></param>
        public MonsterEntity(long id, MonsterGradeDAO monsterGrade, AbstractFighter invocator = null, bool staticInvocation = false)
            : base(EntityTypeEnum.TYPE_MONSTER_FIGHTER, id, staticInvocation)
        {
            Grade = monsterGrade;

            Statistics = new GenericStats(monsterGrade);
            SpellBook = SpellBookFactory.Instance.Create(this);

            RealLife = MaxLife;
            SkinSize = SkinSizeBase;
            Invocator = invocator;
        }
        /// <summary>
        /// 
        /// </summary>
        public TaxCollectorEntity(GuildInstance guild, TaxCollectorDAO record)
            : base(EntityTypeEnum.TYPE_TAX_COLLECTOR, record.Id)
        {
            DatabaseRecord = record;
            Guild = guild;

            MapId = DatabaseRecord.MapId;
            CellId = DatabaseRecord.CellId;

            Defenders = new List<GuildMember>();
            FarmedItems = new Dictionary<int, int>();

            Statistics = new GenericStats();
            Statistics.Merge(guild.Statistics.BaseStatistics);
            SpellBook = SpellBookFactory.Instance.Create(this);
            Storage = new TaxCollectorInventory(this);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="account"></param>
        /// <param name="characterDAO"></param>
        /// <param name="type"></param>
        public CharacterEntity(AccountTicket account, CharacterDAO characterDAO, EntityTypeEnum type = EntityTypeEnum.TYPE_CHARACTER)
            : base(type, characterDAO.Id)
        {
            m_lastRegenTime = -1;
            m_lastEmoteId = -1;

            Away = false;
            DatabaseRecord = characterDAO;
            Alignment = characterDAO.Alignment;

            Account = account;
            PartyId = -1;
            PartyInvitedPlayerId = -1;
            PartyInviterPlayerId = -1;
            GuildInvitedPlayerId = -1;
            GuildInviterPlayerId = -1;
            NotifyOnFriendConnection = true;

            Quests = new List<CharacterQuest>(characterDAO.Quests.Select(record => new CharacterQuest(this, record)));

            CharacterJobs = new JobBook(this);
            Statistics = new GenericStats(characterDAO);
            SpellBook = SpellBookFactory.Instance.Create(this);
            Waypoints = CharacterWaypointRepository.Instance.GetByCharacterId(Id);
            FrameManager = new FrameManager<CharacterEntity, string>(this);
            Inventory = new CharacterInventory(this);
            Bank = BankManager.Instance.GetBankByAccountId(AccountId);
            PersonalShop = new PersistentInventory((int)EntityTypeEnum.TYPE_MERCHANT, Id);
            Relations = SocialRelationRepository.Instance.GetByAccountId(AccountId);

            var guildMember = GuildManager.Instance.GetMember(characterDAO.Guild.GuildId, Id);
            if (guildMember != null)
                if (type == EntityTypeEnum.TYPE_CHARACTER)
                    guildMember.CharacterConnected(this);
                else
                    SetCharacterGuild(guildMember); // Merchant

            SetChatChannel(ChatChannelEnum.CHANNEL_GUILD, () => DispatchGuildMessage);
            SetChatChannel(ChatChannelEnum.CHANNEL_GROUP, () => DispatchPartyMessage);

            RefreshPersonalShopTaxe();
            CheckRestrictions();
            LoadEquippedMount();
        }
Exemplo n.º 6
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public GenericStats GetStatistics()
 {
     var statistics = new GenericStats();
     foreach (var effect in Template.RandomEffects)            
         statistics.AddEffect(effect.Type, effect.Random * Level);            
     return statistics;         
 }
Exemplo n.º 7
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="Stats"></param>
 public void UnMerge(GenericStats Stats)
 {
     foreach (var effect in Stats.Effects)
     {
         if (!m_effects.ContainsKey(effect.Key))
             m_effects.Add(effect.Key, new GenericEffect(effect.Key));
         m_effects[effect.Key].UnMerge(effect.Value);
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="Stats"></param>
 public void UnMerge(StatsType type, GenericStats Stats)
 {
     foreach (var effect in Stats.Effects.Except(Stats.WeaponEffects))
     {
         if (!m_effects.ContainsKey(effect.Key))
             m_effects.Add(effect.Key, new GenericEffect(effect.Key));
         m_effects[effect.Key].UnMerge(type, effect.Value);
     }
 }