예제 #1
0
 public override void OverridableEndFight(FightTeam Winners, FightTeam Loosers)
 {
     foreach (var Fighter in Loosers.GetFighters())
     {
         this.myResult.AddResult(Fighter, false);
         if (Fighter is PercepteurFighter)
         {
             this.Map.DestroyActor((Fighter as PercepteurFighter).TaxCollector);
             (Fighter as PercepteurFighter).TaxCollector.Guild.Send(new GuildFightInformationsMesssage((Fighter as PercepteurFighter).TaxCollector.Guild));
             (Fighter as PercepteurFighter).TaxCollector.Guild.Send(new GuildAttackedTaxcollector(AttackedTaxcollectorState.DIED, (Fighter as PercepteurFighter).TaxCollector));
             TaxCollectorTable.TryDeleteTax((Fighter as PercepteurFighter).TaxCollector);
         }
     }
     foreach (var Fighter in Winners.GetFighters())
     {
         this.myResult.AddResult(Fighter, true);
         if (Fighter is PercepteurFighter)
         {
             (Fighter as PercepteurFighter).TaxCollector.Guild.Send(new GuildFightInformationsMesssage((Fighter as PercepteurFighter).TaxCollector.Guild));
             (Fighter as PercepteurFighter).TaxCollector.Guild.Send(new GuildAttackedTaxcollector(AttackedTaxcollectorState.SURVIVED, (Fighter as PercepteurFighter).TaxCollector));
             (Fighter as PercepteurFighter).TaxCollector.inFight      = 0;
             (Fighter as PercepteurFighter).TaxCollector.CurrentFight = null;
             (Fighter as PercepteurFighter).TaxCollector.Map.SpawnActor((Fighter as PercepteurFighter).TaxCollector);
         }
     }
     base.EndFight();
 }
예제 #2
0
        public override bool CloseExchange(bool Success = false)
        {
            Npc.Guild.Send(new GuildFightInformationsMesssage(Npc.Guild));
            Npc.Guild.Send(new GuildTaxCollectorMessage("G" + Npc.N1 + "," + Npc.N2 + "|.|" + Npc.Map.X + "|" + Npc.Map.Y + "|" + myClient.GetCharacter().Name + "|" + Npc.LogXP + ";" + Npc.GetLogItems()));
            Npc.Map.DestroyActor(Npc);
            TaxCollectorTable.TryDeleteTax(Npc);

            this.Finish();

            this.myClient.SetExchange(null);
            this.myClient.Send(new ExchangeLeaveMessage(Success));

            return(true);
        }
예제 #3
0
        private static void ProcesssRemoveTaxCollector(WorldClient Client, string Packet)
        {
            if (!Client.GetCharacter().HasGuild() || !Client.GetCharacter().getCharacterGuild().Can(GuildRightEnum.RIGHT_PUT_PERCEPTOR) || Client.GetFight() != null || Client.GetCharacter().isAaway)
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }
            long TaxID;

            if (!long.TryParse(Packet.Substring(2), out TaxID))
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }
            if (Client.GetCharacter().myMap.GetActor(TaxID) != null && Client.GetCharacter().myMap.GetActor(TaxID).ActorType != World.Maps.GameActorTypeEnum.TYPE_TAX_COLLECTOR)
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }
            var TaxC = Client.GetCharacter().myMap.GetActor(TaxID) as TaxCollector;

            if (TaxC == null || TaxC.inFight > 0)
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }

            Client.GetCharacter().myMap.DestroyActor(TaxC);
            TaxCollectorTable.TryDeleteTax(TaxC);
            StringBuilder toSend = new StringBuilder("gITM").Append(TaxCollector.parsetoGuild(TaxC.GuildID));

            toSend.Append((char)0x00);
            toSend.Append("gT").Append("R").Append(TaxC.N1).Append(",").Append(TaxC.N2).Append("|");
            toSend.Append(TaxC.Mapid).Append("|");
            toSend.Append(TaxC.Map.X).Append("|").Append(TaxC.Map.Y).Append("|").Append(Client.Character.Name);
            Client.Character.GetGuild().Send(new EmptyMessage(toSend.ToString()));
        }