Ejemplo n.º 1
0
 public static void DismissTeam(Team team, Client.GameState client)
 {
     if (client.Team != null)
     {
         if (!client.Entity.Dead && client.Team.TeamLeader)
         {
             Leadership lship = new Leadership();
             lship.Type = 1;
             foreach (Client.GameState Teammate in client.Team.Teammates)
             {
                 if (Teammate != null)
                 {
                     if (Teammate.Entity.UID != client.Entity.UID)
                     {
                         lship.UID = Teammate.Entity.UID;
                         Teammate.Send(lship);
                         Teammate.Send(team);
                         Teammate.Team = null;
                         if (Teammate.Entity.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                         {
                             Teammate.Entity.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                             Teammate.Entity.Statistics.CriticalStrike -= 200;
                         }
                         if (Teammate.Entity.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                         {
                             Teammate.Entity.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                             Teammate.Entity.Statistics.MetalResistance -= 30;
                         }
                         if (Teammate.Entity.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                         {
                             Teammate.Entity.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                             Teammate.Entity.Statistics.WoodResistance -= 30;
                         }
                         if (Teammate.Entity.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                         {
                             Teammate.Entity.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                             Teammate.Entity.Statistics.WaterResistance -= 30;
                         }
                         if (Teammate.Entity.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                         {
                             Teammate.Entity.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                             Teammate.Entity.Statistics.FireResistance -= 30;
                         }
                         if (Teammate.Entity.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                         {
                             Teammate.Entity.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                             Teammate.Entity.Statistics.EarthResistance -= 30;
                         }
                         if (Teammate.Entity.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                         {
                             Teammate.Entity.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                             Teammate.Entity.Statistics.Immunity -= 200;
                         }
                         Teammate.Entity.RemoveFlag2(Update.Flags2.FendAura);
                         Teammate.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
                         Teammate.Entity.RemoveFlag2(Update.Flags2.MetalAura);
                         Teammate.Entity.RemoveFlag2(Update.Flags2.WoodAura);
                         Teammate.Entity.RemoveFlag2(Update.Flags2.WaterAura);
                         Teammate.Entity.RemoveFlag2(Update.Flags2.FireAura);
                         Teammate.Entity.RemoveFlag2(Update.Flags2.EarthAura);
                         Teammate.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
                     }
                 }
             }
             lship.UID = client.Entity.UID;
             client.Send(lship);
             client.Send(team);
             client.Team = null;
             client.Entity.RemoveFlag2(Update.Flags2.FendAura);
             client.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
             client.Entity.RemoveFlag2(Update.Flags2.MetalAura);
             client.Entity.RemoveFlag2(Update.Flags2.WoodAura);
             client.Entity.RemoveFlag2(Update.Flags2.WaterAura);
             client.Entity.RemoveFlag2(Update.Flags2.FireAura);
             client.Entity.RemoveFlag2(Update.Flags2.EarthAura);
             client.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
             client.Entity.RemoveFlag(Update.Flags.TeamLeader);
         }
     }
 }
Ejemplo n.º 2
0
 public static void CreateTeam(Team team, Client.GameState client)
 {
     if (!client.Entity.Dead && client.Team == null)
     {
         Leadership lship = new Leadership();
         lship.Type = 1;
         lship.UID = client.Entity.UID;
         lship.LeaderUID = client.Entity.UID;
         lship.IsLeader = 1;
         client.Send(lship);
         client.Entity.AddFlag(Update.Flags.TeamLeader);
         client.Team = new Conquer_Online_Server.Game.ConquerStructures.Team();
         client.Team.Active = true;
         client.Team.TeamLeader = true;
         client.Team.Add(client);
         client.Send(team);
     }
 }