示例#1
0
  private void RequestSimWar(int type, String clan1_name, String clan2_name) {
    if (clan1_name == null || clan2_name == null) {
      return;
    }

    L1Clan clan1 = L1World.getInstance().getClan(clan1_name);
    if (clan1 != null) {
      L1PcInstance clan1_member[] = clan1.getOnlineClanMember();
      for (int cnt = 0; cnt < clan1_member.length; cnt++) {
        clan1_member[cnt].sendPackets(new S_War(type, clan1_name, clan2_name));
      }
    }

    if (type == 1 || type == 2 || type == 3) {
      L1Clan clan2 = L1World.getInstance().getClan(clan2_name);
      if (clan2 != null) {
        L1PcInstance clan2_member[] = clan2.getOnlineClanMember();
        for (int cnt = 0; cnt < clan2_member.length; cnt++) {
          if (type == 1) {
            clan2_member[cnt].sendPackets(new S_War(type, clan1_name, clan2_name));
          } else if (type == 2 || type == 3) {
            clan2_member[cnt].sendPackets(new S_War(type, clan1_name, clan2_name));
            clan2_member[cnt].sendPackets(new S_War(4, clan2_name, clan1_name));
          }
        }
      }
    }

    if (type == 2 || type == 3) {
      _isWarTimerDelete = true;
      delete();
    }
  }
示例#2
0
  public void CeaseCastleWar() {
    String defence_clan_name = GetDefenceClanName();
    String clanList[] = GetAttackClanList();
    if (defence_clan_name != null) {
      L1World.getInstance()
          .broadcastPacketToAll(new S_ServerMessage(231, defence_clan_name, clanList[0]));
    }

    L1Clan defence_clan = L1World.getInstance().getClan(defence_clan_name);
    if (defence_clan != null) {
      L1PcInstance defence_clan_member[] = defence_clan.getOnlineClanMember();
      for (int i = 0; i < defence_clan_member.length; i++) {
        defence_clan_member[i].sendPackets(new S_War(4, defence_clan_name, clanList[0]));
      }
    }
    L1Clan clan = null;
    L1PcInstance clan_member[] = null;
    for (int j = 0; j < clanList.length; j++) {
      if (clanList[j] != null) {
        L1World.getInstance()
            .broadcastPacketToAll(new S_ServerMessage(227, defence_clan_name, clanList[j]));
        clan = L1World.getInstance().getClan(clanList[j]);
        if (clan != null) {
          clan_member = clan.getOnlineClanMember();
          for (int k = 0; k < clan_member.length; k++) {
            clan_member[k].sendPackets(new S_War(3, clanList[j], defence_clan_name));
          }
        }
      }
    }

    _isWarTimerDelete = true;
    delete();
  }
示例#3
0
 public int GetCastleId() {
   int castle_id = 0;
   if (GetWarType() == 1) {
     L1Clan clan = L1World.getInstance().getClan(GetDefenceClanName());
     if (clan != null) {
       castle_id = clan.getCastleId();
     }
   }
   return castle_id;
 }
示例#4
0
 public L1Castle GetCastle() {
   L1Castle l1castle = null;
   if (GetWarType() == 1) {
     L1Clan clan = L1World.getInstance().getClan(GetDefenceClanName());
     if (clan != null) {
       int castle_id = clan.getCastleId();
       l1castle = CastleTable.getInstance().getCastleTable(castle_id);
     }
   }
   return l1castle;
 }
示例#5
0
  private void RequestCastleWar(int type, String clan1_name, String clan2_name) {
    if (clan1_name == null || clan2_name == null) {
      return;
    }

    L1Clan clan1 = L1World.getInstance().getClan(clan1_name);
    if (clan1 != null) {
      L1PcInstance clan1_member[] = clan1.getOnlineClanMember();
      for (int cnt = 0; cnt < clan1_member.length; cnt++) {
        clan1_member[cnt].sendPackets(new S_War(type, clan1_name, clan2_name));
      }
    }

    int attack_clan_num = GetAttackClanListSize();

    if (type == 1 || type == 2 || type == 3) {
      L1Clan clan2 = L1World.getInstance().getClan(clan2_name);
      if (clan2 != null) {
        L1PcInstance clan2_member[] = clan2.getOnlineClanMember();
        for (int cnt = 0; cnt < clan2_member.length; cnt++) {
          if (type == 1) {
            clan2_member[cnt].sendPackets(new S_War(type, clan1_name, clan2_name));
          } else if (type == 2) {
            clan2_member[cnt].sendPackets(new S_War(type, clan1_name, clan2_name));
            if (attack_clan_num == 1) {
              clan2_member[cnt].sendPackets(new S_War(4, clan2_name, clan1_name));
            } else {
              clan2_member[cnt].sendPackets(new S_ServerMessage(228, clan1_name, clan2_name));
              RemoveAttackClan(clan1_name);
            }
          } else if (type == 3) {
            clan2_member[cnt].sendPackets(new S_War(type, clan1_name, clan2_name));
            if (attack_clan_num == 1) {
              clan2_member[cnt].sendPackets(new S_War(4, clan2_name, clan1_name));
            } else {
              clan2_member[cnt].sendPackets(new S_ServerMessage(227, clan1_name, clan2_name));
              RemoveAttackClan(clan1_name);
            }
          }
        }
      }
    }

    if ((type == 2 || type == 3) && attack_clan_num == 1) {
      _isWarTimerDelete = true;
      delete();
    }
  }