public TaxCollectorTrade(TaxCollectorNpc taxCollector, Character character)
 {
     this.TaxCollector = taxCollector;
     this.Character    = character;
     base.FirstTrader  = new CollectorTrader(taxCollector, character, this);
     base.SecondTrader = new EmptyTrader(taxCollector.Id, this);
 }
Ejemplo n.º 2
0
 public CharacterCollector(TaxCollectorNpc taxCollector, Character character, TaxCollectorExchange taxCollectorTrade)
     : base(taxCollectorTrade)
 {
     TaxCollector  = taxCollector;
     Character     = character;
     RecoltedItems = new Dictionary <int, TaxCollectorItem>();
 }
Ejemplo n.º 3
0
        public void RemoveTaxCollector(TaxCollectorNpc taxCollector)
        {
            this.m_taxCollectors.Remove(taxCollector);
            Singleton <TaxCollectorManager> .Instance.RemoveTaxCollectorSpawn(taxCollector, true);

            TaxCollectorHandler.SendTaxCollectorMovementRemoveMessage(taxCollector.Guild.Clients, taxCollector);
        }
Ejemplo n.º 4
0
 public TaxCollectorItem CreateTaxCollectorItem(TaxCollectorNpc owner, int id, uint amount)
 {
     if (!this.m_itemTemplates.ContainsKey(id))
     {
         throw new System.Exception(string.Format("Template id '{0}' doesn't exist", id));
     }
     return(this.CreateTaxCollectorItem(owner, this.m_itemTemplates[id], amount));
 }
Ejemplo n.º 5
0
 public void RemoveTaxCollectors()
 {
     TaxCollectorNpc[] array = this.m_taxCollectors.ToArray();
     for (int i = 0; i < array.Length; i++)
     {
         TaxCollectorNpc taxCollectorNpc = array[i];
         this.m_taxCollectors.Remove(taxCollectorNpc);
         Singleton <TaxCollectorManager> .Instance.RemoveTaxCollectorSpawn(taxCollectorNpc, true);
     }
 }
Ejemplo n.º 6
0
 public TaxCollectorItem(TaxCollectorNpc owner, int guid, ItemTemplate template, System.Collections.Generic.List <EffectBase> effects, uint stack)
 {
     base.Record = new TaxCollectorItemRecord
     {
         Id       = guid,
         OwnerId  = owner.GlobalId,
         Template = template,
         Stack    = stack,
         Effects  = effects
     };
 }
Ejemplo n.º 7
0
 public TaxCollectorItem(TaxCollectorNpc owner, int guid, ItemTemplate template, List <EffectBase> effects, uint stack)
 {
     Record = new TaxCollectorItemRecord // create the associated record
     {
         Id       = guid,
         OwnerId  = owner.GlobalId,
         Template = template,
         Stack    = stack,
         Effects  = effects,
     };
 }
		public static void HandleGameRolePlayTaxCollectorFightRequestMessage(WorldClient client, GameRolePlayTaxCollectorFightRequestMessage message)
		{
			TaxCollectorNpc actor = client.Character.Map.GetActor<TaxCollectorNpc>(message.taxCollectorId);
			FighterRefusedReasonEnum fighterRefusedReasonEnum = client.Character.CanAttack(actor);
			if (fighterRefusedReasonEnum != FighterRefusedReasonEnum.FIGHTER_ACCEPTED)
			{
				ContextHandler.SendChallengeFightJoinRefusedMessage(client, client.Character, fighterRefusedReasonEnum);
			}
			FightPvT fightPvT = Singleton<FightManager>.Instance.CreatePvTFight(client.Character.Map);
			fightPvT.RedTeam.AddFighter(client.Character.CreateFighter(fightPvT.RedTeam));
			fightPvT.BlueTeam.AddFighter(actor.CreateFighter(fightPvT.BlueTeam));
			fightPvT.StartPlacement();
		}
Ejemplo n.º 9
0
        public TaxCollectorFighter(FightTeam team, TaxCollectorNpc taxCollector) : base(team, taxCollector.Guild.GetTaxCollectorSpells(), taxCollector.GlobalId)
        {
            this.TaxCollectorNpc = taxCollector;
            this.Look            = this.TaxCollectorNpc.Look.Clone();
            this.m_stats         = new StatsFields(this);
            this.m_stats.Initialize(this.TaxCollectorNpc);
            Cell cell;

            if (base.Fight.FindRandomFreeCell(this, out cell, false))
            {
                this.Position = new ObjectPosition(this.TaxCollectorNpc.Map, cell, this.TaxCollectorNpc.Direction);
            }
        }
		public static void HandleGuildFightLeaveRequestMessage(WorldClient client, GuildFightLeaveRequestMessage message)
		{
			if (client.Character.Guild != null)
			{
				TaxCollectorNpc taxCollectorNpc = client.Character.Guild.TaxCollectors.FirstOrDefault((TaxCollectorNpc x) => x.GlobalId == message.taxCollectorId);
				if (taxCollectorNpc != null && taxCollectorNpc.IsFighting)
				{
					FightPvT fightPvT = taxCollectorNpc.Fighter.Fight as FightPvT;
					if (fightPvT != null)
					{
						fightPvT.RemoveDefender(client.Character);
					}
				}
			}
		}
Ejemplo n.º 11
0
        public TaxCollectorItem CreateTaxCollectorItem(TaxCollectorNpc owner, int id, int amount)
        {
            if (amount < 0)
            {
                throw new ArgumentException("amount < 0", "amount");
            }


            if (!m_itemTemplates.ContainsKey(id))
            {
                throw new Exception(string.Format("Template id '{0}' doesn't exist", id));
            }

            return(CreateTaxCollectorItem(owner, m_itemTemplates[id], amount));
        }
Ejemplo n.º 12
0
        public TaxCollectorItem CreateTaxCollectorItem(TaxCollectorNpc owner, ItemTemplate template, uint amount)
        {
            int id = AutoAssignedRecord <TaxCollectorItemRecord> .PopNextId();

            TaxCollectorItemRecord record = new TaxCollectorItemRecord
            {
                Id       = id,
                OwnerId  = owner.Id,
                Template = template,
                Stack    = amount,
                Effects  = this.GenerateItemEffects(template, false),
                IsNew    = true
            };

            return(new TaxCollectorItem(record));
        }
Ejemplo n.º 13
0
        public TaxCollectorItem CreateTaxCollectorItem(TaxCollectorNpc owner, ItemTemplate template, int amount)
        {
            if (amount < 0)
            {
                throw new ArgumentException("amount < 0", "amount");
            }
            var guid   = TaxCollectorItemRecord.PopNextId();
            var record = new TaxCollectorItemRecord // create the associated record
            {
                Id       = guid,
                OwnerId  = owner.GlobalId,
                Template = template,
                Stack    = (uint)amount,
                Effects  = GenerateItemEffects(template),
                IsNew    = true,
            };

            return(new TaxCollectorItem(record));
        }
 public static void HandleExchangeRequestOnTaxCollectorMessage(WorldClient client, ExchangeRequestOnTaxCollectorMessage message)
 {
     if (client.Character.Guild != null)
     {
         TaxCollectorNpc taxCollector = client.Character.Map.TaxCollector;
         if (taxCollector != null)
         {
             if (!taxCollector.IsTaxCollectorOwner(client.Character.GuildMember))
             {
                 client.Send(new TaxCollectorErrorMessage(2));
             }
             else
             {
                 TaxCollectorTrade taxCollectorTrade = new TaxCollectorTrade(taxCollector, client.Character);
                 taxCollectorTrade.Open();
             }
         }
     }
 }
		public static void HandleGuildFightJoinRequestMessage(WorldClient client, GuildFightJoinRequestMessage message)
		{
			if (client.Character.Guild != null)
			{
				TaxCollectorNpc taxCollectorNpc = client.Character.Guild.TaxCollectors.FirstOrDefault((TaxCollectorNpc x) => x.GlobalId == message.taxCollectorId);
				if (taxCollectorNpc != null && taxCollectorNpc.IsFighting)
				{
					FightPvT fightPvT = taxCollectorNpc.Fighter.Fight as FightPvT;
					if (fightPvT != null)
					{
						FighterRefusedReasonEnum fighterRefusedReasonEnum = fightPvT.AddDefender(client.Character);
						if (fighterRefusedReasonEnum != FighterRefusedReasonEnum.FIGHTER_ACCEPTED)
						{
							ContextHandler.SendChallengeFightJoinRefusedMessage(client, client.Character, fighterRefusedReasonEnum);
						}
					}
				}
			}
		}
Ejemplo n.º 16
0
        public TaxCollectorFighter(FightTeam team, TaxCollectorNpc taxCollector)
            : base(team, taxCollector.Guild.GetTaxCollectorSpells(), taxCollector.GlobalId)
        {
            Id = Fight.GetNextContextualId();
            TaxCollectorNpc = taxCollector;
            Look            = TaxCollectorNpc.Look.Clone();
            Items           = TaxCollectorNpc.Bag.SelectMany(x => Enumerable.Repeat(x.Template.Id, (int)x.Stack))
                              .Shuffle()
                              .ToList();
            Kamas = TaxCollectorNpc.GatheredKamas;

            m_stats = new StatsFields(this);
            m_stats.Initialize(TaxCollectorNpc);

            if (!Fight.FindRandomFreeCell(this, out var cell, false))
            {
                return;
            }

            Position = new ObjectPosition(TaxCollectorNpc.Map, cell, TaxCollectorNpc.Direction);
        }
Ejemplo n.º 17
0
 public static void SendGuildFightPlayersEnemiesListMessage(IPacketReceiver client, TaxCollectorNpc taxCollector, IEnumerable <Character> characters)
 {
     client.Send(new GuildFightPlayersEnemiesListMessage(taxCollector.GlobalId, characters.Select(x => x.GetCharacterMinimalPlusLookInformations())));
 }
Ejemplo n.º 18
0
 public static void SendGuildFightPlayersHelpersJoinMessage(IPacketReceiver client, TaxCollectorNpc taxCollector, Character character)
 {
     client.Send(new GuildFightPlayersHelpersJoinMessage(taxCollector.GlobalId, character.GetCharacterMinimalPlusLookInformations()));
 }
Ejemplo n.º 19
0
 public static void SendTaxCollectorAttackedMessage(IPacketReceiver client, TaxCollectorNpc taxCollector)
 {
     client.Send(new TaxCollectorAttackedMessage(taxCollector.FirstNameId, taxCollector.LastNameId, (short)taxCollector.Map.Position.X, (short)taxCollector.Map.Position.Y,
                                                 taxCollector.Map.Id, (short)taxCollector.Map.SubArea.Id, taxCollector.Guild.GetBasicGuildInformations()));
 }
Ejemplo n.º 20
0
 public static void SendGuildFightPlayersEnemyRemoveMessage(IPacketReceiver client, TaxCollectorNpc taxCollector, Character character)
 {
     client.Send(new GuildFightPlayersEnemyRemoveMessage(taxCollector.GlobalId, character.Id));
 }
Ejemplo n.º 21
0
 public void AddTaxCollector(TaxCollectorNpc taxCollector)
 {
     this.m_taxCollectors.Add(taxCollector);
     TaxCollectorHandler.SendTaxCollectorMovementAddMessage(taxCollector.Guild.Clients, taxCollector);
 }
Ejemplo n.º 22
0
 public static void SendTaxCollectorMovementMessage(IPacketReceiver client, TaxCollectorMovementTypeEnum movementType, TaxCollectorNpc taxCollector, int playerId, string name)
 {
     client.Send(new TaxCollectorMovementMessage((sbyte)movementType, taxCollector.GetTaxCollectorBasicInformations(), playerId, name));
 }
 public static void SendStorageInventoryContentMessage(IPacketReceiver client, TaxCollectorNpc taxCollector)
 {
     client.Send(new ExchangeStartedMessage(8));
     client.Send(taxCollector.GetStorageInventoryContent());
 }
Ejemplo n.º 24
0
 public static void SendTaxCollectorMovementRemoveMessage(IPacketReceiver client, TaxCollectorNpc taxCollector)
 {
     client.Send(new TaxCollectorMovementRemoveMessage(taxCollector.GlobalId));
 }
Ejemplo n.º 25
0
 public TaxCollectorInfoDialog(Character character, TaxCollectorNpc taxCollector)
 {
     this.TaxCollector = taxCollector;
     this.Character    = character;
 }
Ejemplo n.º 26
0
 public static void SendTaxCollectorAttackedResultMessage(IPacketReceiver client, bool deadOrAlive, TaxCollectorNpc taxCollector)
 {
     client.Send(new TaxCollectorAttackedResultMessage(deadOrAlive, taxCollector.GetTaxCollectorBasicInformations(), taxCollector.Guild.GetBasicGuildInformations()));
 }
Ejemplo n.º 27
0
 public void RemoveTaxCollector(TaxCollectorNpc taxCollector)
 {
     m_taxCollectors.Remove(taxCollector);
     TaxCollectorManager.Instance.RemoveTaxCollectorSpawn(taxCollector);
     TaxCollectorHandler.SendTaxCollectorMovementRemoveMessage(taxCollector.Guild.Clients, taxCollector);
 }
Ejemplo n.º 28
0
 public void AddTaxCollector(TaxCollectorNpc taxCollector)
 {
     m_taxCollectors.Add(taxCollector);
 }
Ejemplo n.º 29
0
 public TaxCollectorBag(TaxCollectorNpc owner)
 {
     Owner = owner;
 }
Ejemplo n.º 30
0
 public static void SendTaxCollectorMovementAddMessage(IPacketReceiver client, TaxCollectorNpc taxCollector)
 {
     client.Send(new TaxCollectorMovementAddMessage(taxCollector.GetNetworkTaxCollector()));
 }