Example #1
0
        public TaxCollectorNpc(WorldMapTaxCollectorRecord record, int contextId)
        {
            this.m_record    = record;
            this.m_contextId = contextId;
            this.Bag         = new TaxCollectorBag(this);
            if (!record.MapId.HasValue)
            {
                throw new System.Exception("TaxCollector's map not found");
            }
            this.Position = new ObjectPosition(record.Map, record.Map.Cells[this.m_record.Cell], (DirectionsEnum)this.m_record.Direction);
            this.Guild    = Singleton <GuildManager> .Instance.TryGetGuild(this.Record.GuildId);

            this.LoadRecord();
        }
Example #2
0
        /// <summary>
        /// Create and load the tax collector (IO)
        /// </summary>
        public TaxCollectorNpc(WorldMapTaxCollectorRecord record, int contextId)
        {
            m_record    = record;
            m_contextId = contextId;
            Bag         = new TaxCollectorBag(this);

            if (record.MapId == null)
            {
                throw new Exception("TaxCollector's map not found");
            }

            Position = new ObjectPosition(
                record.Map,
                record.Map.Cells[m_record.Cell],
                (DirectionsEnum)m_record.Direction);


            Guild = GuildManager.Instance.TryGetGuild(Record.GuildId);
            LoadRecord();
        }
Example #3
0
        public TaxCollectorNpc(int globalId, int contextId, ObjectPosition position, Guild guild, string callerName)
        {
            AsyncRandom asyncRandom = new AsyncRandom();

            this.m_contextId = contextId;
            this.Position    = position;
            this.Guild       = guild;
            this.Bag         = new TaxCollectorBag(this);
            this.m_record    = new WorldMapTaxCollectorRecord
            {
                Id          = globalId,
                Map         = this.Position.Map,
                Cell        = (int)this.Position.Cell.Id,
                Direction   = (int)this.Position.Direction,
                FirstNameId = (short)asyncRandom.Next(1, 154),
                LastNameId  = (short)asyncRandom.Next(1, 253),
                GuildId     = guild.Id,
                CallerName  = callerName,
                Date        = System.DateTime.Now
            };
            this.IsRecordDirty = true;
        }
Example #4
0
        /// <summary>
        /// Create a new tax collector with a new record (no IO)
        /// </summary>
        public TaxCollectorNpc(int globalId, int contextId, ObjectPosition position, Guild guild, Character caller)
        {
            m_contextId = contextId;
            Position    = position;
            Guild       = guild;
            Bag         = new TaxCollectorBag(this);
            m_record    = new WorldMapTaxCollectorRecord
            {
                Id          = globalId,
                Map         = Position.Map,
                Cell        = Position.Cell.Id,
                Direction   = (int)Position.Direction,
                FirstNameId = (short)TaxCollectorManager.Instance.GetRandomTaxCollectorFirstname(),
                LastNameId  = (short)TaxCollectorManager.Instance.GetRandomTaxCollectorName(),
                GuildId     = guild.Id,
                CallerName  = caller.Name,
                CallerId    = caller.Id,
                Date        = DateTime.Now
            };

            IsRecordDirty = true;
        }